package com.example.mylibrary.mvp.presenter;

import com.example.mylibrary.mvp.model.IModel;
import com.example.mylibrary.mvp.view.IView;

import javax.inject.Inject;

public class BasePresenter<M extends IModel,V extends IView> implements IPresenter{
   protected   M mModel;  //m层
   protected V mView;     //v层
    
    @Inject
    public BasePresenter(M mModel, V mView) {
        this.mModel = mModel;
        this.mView = mView;
    }
    @Override
    public void Destroy() {
        if (mModel != null) {
            mModel.Destroy();
            mModel = null;
        }
        if (mView != null) {
            mView = null;
        }
        System.gc();  //回收
    }
}
